package demo

func FactorialRescuvie(n int) int {
	if n == 0 {
		return 1
	}

	return n * FactorialRescuvie(n-1)
}
func FactorialRescuvieTail(n int, a int) int {
	if n == 1 {
		return a
	}

	return FactorialRescuvieTail(n-1, a*n)
}
func F(n int) int {
	if n == 0 {
		return 0
	}
	if n == 1 {
		return 1
	}

	return F(n-1) + F(n-2)

}
func FTail(n int, a1, a2 int) int {
	if n == 1 {
		return a1
	}

	return FTail(n-1, a2, a1+a2)

}
